 
  

 






<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>

<!-- Mirrored from www.javapractices.com/topic/TopicAction.do?Id=151 by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 12 Jun 2011 17:28:07 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack -->
<head>
 <title>
  Java Practices -> Verify input with regular expressions
 </title>
 <link rel="stylesheet" type="text/css" href="../stylesheet8.css" media="all">
 
 <link rel="shortcut icon" href='../images/favicon.ico' type="image/vnd.microsoft.icon">
 <meta name="description" content="Concise presentations of java programming practices, tasks, and conventions, amply illustrated with syntax highlighted code examples.">
 
 <meta name='keywords' content='regex,RegexInputVerifier,regexp,swing,java,java programming,java practices,java idiom,java style,java design patterns,java coding conventions,'>
 
 
</head>
 
<body>


<div class='menu-bar'>
 
  <a href='../home/HomeAction.html' title='Table of Contents'>Home</a> |
  <a href='../vote/VoteSummaryAction-2.html' title='View Poll Results'>Poll</a> |
   
  <A href='../feedback/FeedbackAction451f-2.html?Operation=Show' title='Send Your Feedback'>Wiki</a> |
  <b><a href='../source/SourceAction-2.html' title='Grab Source Code'>Source Code</a></b><IMG class='no-margin' SRC="../images/goldstar.gif" ALT=""> |

  <a href='http://www.web4j.com/Java_Web_Application_Framework_Overview.jsp?From=1' title='Free Download - Java Web Application Framework'><b>WEB4J</b></a> |
  
  <a href='http://www.date4j.net/' title='Replacement for java.util.Date'><b>DATE4J</b></a> |

   <a href='../references/ReferencesAction-2.html' title='References'>Links</a>
   
  <form action='http://www.javapractices.com/search/SearchAction.do' method='get' class='search-form'>
   <input type='text' name='SearchTerms' value="" size=12 maxlength=50 class='search'>
   <input type='submit' value="Search">
  </form>
 
</div>

<P>



  

 






<p class="display-messages">

 

 

</p>


<div class="main-layout">
 
   

 




<div class='page-title'>Verify input with regular expressions</div>

<div class='main-body'>
 
<br><tt>JTextField</tt> objects are often used to allow user input and
editing of data. The <tt><a href="http://java.sun.com/javase/6/docs/api/javax/swing/InputVerifier.html">InputVerifier</a></tt>
class is used to verify such input.
<p><b>Example</b>
<p><tt>RegexInputVerifier</tt> uses <a href="http://java.sun.com/javase/6/docs/api/java/util/regex/package-summary.html">regular
expressions</a> to verify input. Verification is performed when focus moves
from an associated <tt>JTextField</tt>; if an error is found, the system
beeps and an error message is placed in the <tt>JTextField</tt>.
<p>Items to note :
<ul>
<li>
<tt>shouldYieldFocus</tt> and <tt>verify</tt> are defined originally in
<tt>InputVerifier</tt></li>

<li>
there are several convenience objects provided by this class, which are
useful for many common cases</li>

<li>
the constructor uses a <a href='TopicAction2161-2.html'>type-safe enumeration</a> (<tt>UseToolTip</tt>) as an
argument, instead of a primitive <tt>boolean</tt> value. This forces constructor
calls to <a href='TopicAction37c7-2.html'>have greater clarity</a>.</li>
</ul>
<br>
<PRE>

<span class='keyword'>package</span> hirondelle.stocks.portfolio;

<span class='keyword'>import</span> java.util.*;
<span class='keyword'>import</span> java.util.regex.*;
<span class='keyword'>import</span> javax.swing.*;
<span class='keyword'>import</span> javax.swing.text.*;
<span class='keyword'>import</span> java.awt.*;
<span class='keyword'>import</span> java.awt.event.*;

<span class='keyword'>import</span> hirondelle.stocks.util.Util;
<span class='keyword'>import</span> hirondelle.stocks.util.Consts;
<span class='keyword'>import</span> hirondelle.stocks.util.Args;
<span class='keyword'>import</span> hirondelle.stocks.util.ui.UiUtil;

<span class='comment'>/**
* Verifies user input into a {@link javax.swing.text.JTextComponent} versus a 
* regular expression.
* 
*&lt;P&gt; This class is likely useful for a wide number of simple input needs.
* See the {@link java.util.regex.Pattern} class for details regarding regular 
* expressions.
*
* &lt;P&gt;The {@link #main} method is provided as a developer tool for  
* testing regular expressions versus user input, but the principal use of this 
* class is to be passed to {@link javax.swing.JComponent#setInputVerifier}.
*
*&lt;P&gt; Upon detection of invalid input, this class takes the following actions : 
*&lt;ul&gt;
* &lt;li&gt; emit a beep
* &lt;li&gt; overwrite the &lt;tt&gt;JTextComponent&lt;/tt&gt; to display the following: 
* INVALID: &quot; (input data) &quot;
* &lt;li&gt; optionally, append the tooltip text to the content of the INVALID message ; this 
* is useful only if the tooltip contains helpful information regarding input.
* Warning : appending the tooltip text may cause the error 
* text to be too long for the corresponding text field. 
*&lt;/ul&gt;
*
*&lt;P&gt; The user of this class is encouraged to always place conditions on data entry 
* in the tooltip for the corresponding field.
*/</span>
<span class='keyword'>final</span> <span class='keyword'>class</span> RegexInputVerifier <span class='keyword'>extends</span> InputVerifier {
  
  <span class='comment'>/* 
  * Implementation Note:
  * Use of JOptionPane to display error messages in an 
  * InputVerifier seems buggy. There also seem to be issues 
  * regarding focus and events.
  */</span>
  
  <span class='comment'>/**
  * Constructor.
  *  
  * @param aPattern regular expression against which all user input will
  * be verified; &lt;tt&gt;aPattern.pattern&lt;/tt&gt; satisfies
  * {@link Util#textHasContent}.
  * @param aUseToolTip indicates if the tooltip text should be appended to 
  * error messages displayed to the user. 
  */</span>
  RegexInputVerifier(Pattern aPattern, UseToolTip aUseToolTip){
    Args.checkForContent( aPattern.pattern() );
    fMatcher = aPattern.matcher(Consts.EMPTY_STRING);
    fUseToolTip = aUseToolTip.getValue();
  }
  
  <span class='comment'>/**
  * Enumeration compels the caller to use a style which reads clearly. 
  */</span>
  <span class='keyword'>enum</span> UseToolTip {
    TRUE(<span class='keyword'>true</span>),
    FALSE(<span class='keyword'>false</span>);
    <span class='keyword'>boolean</span> getValue(){
      <span class='keyword'>return</span> fToggle;
    }
    <span class='keyword'>private</span> <span class='keyword'>boolean</span> fToggle;
    <span class='keyword'>private</span> UseToolTip(<span class='keyword'>boolean</span> aToggle){
      fToggle = aToggle;
    }
  }

  <span class='comment'>/**
  * Always returns &lt;tt&gt;true&lt;/tt&gt;, in this implementation, such that focus can 
  * always transfer to another component whenever the validation fails.
  *
  * &lt;P&gt;If &lt;tt&gt;super.shouldYieldFocus&lt;/tt&gt; returns &lt;tt&gt;false&lt;/tt&gt;, then 
  * notify the user of an error.
  *
  * @param aComponent is a &lt;tt&gt;JTextComponent&lt;/tt&gt;.
  */</span>
  <span class='keyword'>@Override</span> <span class='keyword'>public</span> <span class='keyword'>boolean</span> shouldYieldFocus(JComponent aComponent){
    <span class='keyword'>boolean</span> isValid = <span class='keyword'>super</span>.shouldYieldFocus(aComponent);
    <span class='keyword'>if</span> ( isValid ){
      <span class='comment'>//do nothing
</span>    }
    <span class='keyword'>else</span> {
      JTextComponent textComponent = (JTextComponent)aComponent;
      notifyUserOfError(textComponent);
    }
    <span class='keyword'>return</span> <span class='keyword'>true</span>;
  }
  
  <span class='comment'>/**
  * Return &lt;tt&gt;true&lt;/tt&gt; only if the untrimmed user input matches the 
  * regular expression provided to the constructor.
  *
  * @param aComponent must be a &lt;tt&gt;JTextComponent&lt;/tt&gt;.
  */</span>
  <span class='keyword'>public</span> <span class='keyword'>boolean</span> verify(JComponent aComponent) {
    <span class='keyword'>boolean</span> result = <span class='keyword'>false</span>;
    JTextComponent textComponent = (JTextComponent)aComponent;
    fMatcher.reset( textComponent.getText() );
    <span class='keyword'>if</span> ( fMatcher.matches() ) {
      result =  <span class='keyword'>true</span>;
    }
    <span class='keyword'>return</span> result;
  }
  
  <span class='comment'>/**
  * The text which begins all error messages.
  *
  * The caller may examine their text fields for the presence of 
  * &lt;tt&gt;ERROR_MESSAGE_START&lt;/tt&gt;, before processing input.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> String ERROR_MESSAGE_START = <span class='literal'>"INVALID: "</span>;

  <span class='comment'>/**
  * Matches user input against a regular expression.
  */</span>
  <span class='keyword'>private</span> Matcher fMatcher;
  
  <span class='comment'>/**
  * Indicates if the JTextField's tooltip text is to be appended to 
  * error messages, as a second way of reminding the user.
  */</span>
  <span class='keyword'>private</span> <span class='keyword'>boolean</span> fUseToolTip;

  <span class='comment'>/* 
  * Various regular expression patterns used to 
  * construct convenience objects of this class:
  */</span>
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String TEXT_FIELD =  <span class='literal'>"^(&#092;&#092;S)(.){1,75}(&#092;&#092;S)$"</span>;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String NON_NEGATIVE_INTEGER_FIELD = <span class='literal'>"(&#092;&#092;d){1,9}"</span>;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String INTEGER_FIELD = <span class='literal'>"(-)?"</span> + NON_NEGATIVE_INTEGER_FIELD;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String NON_NEGATIVE_FLOATING_POINT_FIELD = 
    <span class='literal'>"(&#092;&#092;d){1,10}&#092;&#092;.(&#092;&#092;d){1,10}"</span>
  ;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String FLOATING_POINT_FIELD =  
    <span class='literal'>"(-)?"</span> + NON_NEGATIVE_FLOATING_POINT_FIELD
  ;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String NON_NEGATIVE_MONEY_FIELD =  <span class='literal'>"(&#092;&#092;d){1,15}(&#092;&#092;.(&#092;&#092;d){2})?"</span>;
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>final</span> String MONEY_FIELD =  <span class='literal'>"(-)?"</span> + NON_NEGATIVE_MONEY_FIELD;
  
  <span class='comment'>/**  
  * Convenience object for input of integers: ...-2,-1,0,1,2...
  *
  * &lt;P&gt;From 1 to 9 digits, possibly preceded by a minus sign.
  * Corresponds approximately to the spec of &lt;tt&gt;Integer.parseInt&lt;/tt&gt;.
  * The limit on the number of digits is related to size of &lt;tt&gt;Integer.MAX_VALUE&lt;/tt&gt;
  * and &lt;tt&gt;Integer.MIN_VALUE&lt;/tt&gt;.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier INTEGER = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(INTEGER_FIELD), UseToolTip.FALSE)
  ;

  <span class='comment'>/**
  * Convenience object for input of these integers: 0,1,2...
  *
  *&lt;P&gt; As in {@link #INTEGER}, but with no leading minus sign.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier NON_NEGATIVE_INTEGER = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(NON_NEGATIVE_INTEGER_FIELD), UseToolTip.FALSE)
  ;
         
  <span class='comment'>/**
  * Convenience object for input of short amounts of text.
  *
  * &lt;P&gt;Text contains from 1 to 75 non-whitespace characters.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier TEXT = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(TEXT_FIELD), UseToolTip.FALSE)
  ;
    
  <span class='comment'>/**
  * Convenience object for input of decimals numbers, eg -23.23321, 100.25.
  *
  * &lt;P&gt;Possible leading minus sign, 1 to 10 digits before the decimal, and 1 to 10 
  * digits after the decimal.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier FLOATING_POINT = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(FLOATING_POINT_FIELD), UseToolTip.FALSE)
  ;

  <span class='comment'>/**
  * Convenience object for input of non-negative decimals numbers, eg 23.23321, 100.25.
  *
  * &lt;P&gt;As in {@link #FLOATING_POINT}, but no leading minus sign.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier NON_NEGATIVE_FLOATING_POINT = 
    <span class='keyword'>new</span> RegexInputVerifier(
      Pattern.compile(NON_NEGATIVE_FLOATING_POINT_FIELD), UseToolTip.FALSE
    )
  ;

  <span class='comment'>/**
  * Convenience object for input of money values, eg -23, 100.25.
  *
  * &lt;P&gt;Possible leading minus sign, from 1 to 15 leading digits, and optionally  
  * a decimal place and two decimals.
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier MONEY = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(MONEY_FIELD), UseToolTip.FALSE)
  ;
  
  <span class='comment'>/**
  * Convenience object for input of non-negative money values, eg 23, 100.25.
  *
  * &lt;P&gt;As in {@link #MONEY}, except no leading minus sign
  */</span>
  <span class='keyword'>static</span> <span class='keyword'>final</span> RegexInputVerifier NON_NEGATIVE_MONEY = 
    <span class='keyword'>new</span> RegexInputVerifier(Pattern.compile(NON_NEGATIVE_MONEY_FIELD), UseToolTip.FALSE)
  ;

  <span class='comment'>/**
  * If an error message is currently displayed in aComponent, then 
  * do nothing; otherwise, display an error message to the user in a
  * aComponent (see class description for format of message).
  */</span>
  <span class='keyword'>private</span> <span class='keyword'>void</span> notifyUserOfError(JTextComponent aTextComponent){
    <span class='keyword'>if</span> ( isShowingErrorMessage(aTextComponent) ){
      <span class='comment'>//do nothing, since user has not yet re-input.
</span>    }
    <span class='keyword'>else</span> {
      UiUtil.beep();
      showErrorMessage(aTextComponent);
    }
  }

  <span class='keyword'>private</span> <span class='keyword'>boolean</span> isShowingErrorMessage(JTextComponent aTextComponent){
    <span class='keyword'>return</span> aTextComponent.getText().startsWith(ERROR_MESSAGE_START);
  }
  
  <span class='keyword'>private</span> <span class='keyword'>void</span> showErrorMessage(JTextComponent aTextComponent) {
    StringBuilder message = <span class='keyword'>new</span> StringBuilder(ERROR_MESSAGE_START);
    message.append(<span class='literal'>"&#092;""</span>);
    message.append(aTextComponent.getText());
    message.append(<span class='literal'>"&#092;""</span>);
    <span class='keyword'>if</span> ( fUseToolTip ) {
      message.append(aTextComponent.getToolTipText());
    }
    aTextComponent.setText(message.toString());
  }
  
  <span class='comment'>/*
  * All members appearing below are used only by the "main" developer test harness.
  */</span>
  
  <span class='comment'>/**
  * Developer test harness for verifying a regular expression, using a simple 
  * graphical interface and a &lt;tt&gt;RegexInputVerifier&lt;/tt&gt;.
  *
  *&lt;p&gt;Use of the GUI is straightforward :
  *&lt;ul&gt;
  *&lt;li&gt; Enter a regular expression (regex).
  *&lt;li&gt; Hit the &lt;tt&gt;Set Regex&lt;/tt&gt; button to begin testing input versus the regex.
  *&lt;li&gt; Enter text into the &lt;tt&gt;Text Input&lt;/tt&gt; field.
  *&lt;li&gt; When focus moves out of the &lt;tt&gt;Text Input&lt;/tt&gt; field, then the input 
  * is verified versus the regex.
  *&lt;li&gt; To try out another regex, simply enter a new one and hit the 
  * &lt;tt&gt;Set Regex&lt;/tt&gt; button.
  *&lt;li&gt; Tooltips offer simple reminders as well.
  *&lt;/ul&gt;
  *
  * &lt;p&gt;(For running this test harness, &lt;tt&gt;RegexInputVerifier&lt;/tt&gt; needs to 
  * be a public class; after testing is finished, it is probably a good idea to 
  * change the scope to package-private, since the services of this class are 
  * used only by the user interface layer.)
  */</span>
  <span class='keyword'>public</span> <span class='keyword'>static</span> <span class='keyword'>void</span> main(String... aArgs){
    showGuiForExercisingVerifier();
  }
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> JFrame fFrame;
  <span class='keyword'>private</span> <span class='keyword'>static</span> JTextField fRegexField;
  <span class='keyword'>private</span> <span class='keyword'>static</span> JTextField fInputField;
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>void</span> showGuiForExercisingVerifier(){
    <span class='comment'>//General layout of the gui:
</span>    <span class='comment'>//  
</span>    <span class='comment'>//  Regular Expression:     [----] 
</span>    <span class='comment'>//  Test Input:             [----]
</span>    <span class='comment'>//
</span>    <span class='comment'>//  Set-Regex     Test       Close
</span>    <span class='comment'>//
</span>    fFrame = <span class='keyword'>new</span> JFrame(<span class='literal'>"Test Regular Expressions - javapractices.com"</span>);
    fFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    JPanel content = <span class='keyword'>new</span> JPanel();
    content.setLayout( <span class='keyword'>new</span> BoxLayout(content, BoxLayout.Y_AXIS) );
    content.setBorder( UiUtil.getStandardBorder() );
    content.add( getEditor() );
    content.add( getCommandRow() );
    
    fFrame.getContentPane().add( content );
    UiUtil.centerAndShow( fFrame );
  }
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> JComponent getEditor(){
    <span class='keyword'>final</span> JPanel content = <span class='keyword'>new</span> JPanel();
    content.setLayout( <span class='keyword'>new</span> GridBagLayout() );
    GridBagConstraints constraints = UiUtil.getConstraints(<span class='literal'>0</span>,<span class='literal'>0</span>);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    fRegexField = UiUtil.addSimpleEntryField(
      content, <span class='literal'>"Regular Expression:"</span>, <span class='keyword'>null</span>, 
      KeyEvent.VK_R, constraints, 
      <span class='literal'>"Double backslashes are not needed. Set Regex to init."</span>
    );
    constraints = UiUtil.getConstraints(<span class='literal'>1</span>,<span class='literal'>0</span>);
    constraints.fill = GridBagConstraints.HORIZONTAL;
    fInputField = UiUtil.addSimpleEntryField(
      content, <span class='literal'>"Test Input:"</span>, <span class='keyword'>null</span>, 
      KeyEvent.VK_I, constraints,
      <span class='literal'>"This text is verified versus the regular expression"</span>
    );
    UiUtil.addVerticalGridGlue(content, <span class='literal'>2</span>);
    <span class='keyword'>return</span> content;
  }
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> JComponent getCommandRow(){
    JButton setRegex = <span class='keyword'>new</span> JButton(<span class='literal'>"Set Regex"</span>);
    setRegex.setMnemonic(KeyEvent.VK_S);
    setRegex.setToolTipText(<span class='literal'>"Start testing input versus the above regular expression"</span>);
    setRegex.addActionListener( <span class='keyword'>new</span> ActionListener() {
      <span class='keyword'>public</span> <span class='keyword'>void</span> actionPerformed(ActionEvent event) {
        setRegex();
      }
    });
    
    JButton test = <span class='keyword'>new</span> JButton(<span class='literal'>"Test"</span>);
    test.setMnemonic(KeyEvent.VK_T);
    test.setToolTipText(<span class='literal'>"Exercises verifier by simply receiving focus"</span>);
    test.addActionListener( <span class='keyword'>new</span> ActionListener() {
      <span class='keyword'>public</span> <span class='keyword'>void</span> actionPerformed(ActionEvent event) {
        <span class='comment'>//do nothing
</span>        <span class='comment'>//exists only as a target for new focus, such that 
</span>        <span class='comment'>//the focus tries to move out of the input field
</span>      }
    });
    
    JButton close = <span class='keyword'>new</span> JButton(<span class='literal'>"Close"</span>);
    close.setMnemonic(KeyEvent.VK_C);
    close.addActionListener( <span class='keyword'>new</span> ActionListener() {
      <span class='keyword'>public</span> <span class='keyword'>void</span> actionPerformed(ActionEvent event) {
        fFrame.dispose();
      }
    });
    
    java.util.List&lt;JComponent&gt; buttons = <span class='keyword'>new</span> ArrayList&lt;JComponent&gt;();
    buttons.add(setRegex) ;
    buttons.add(test);
    buttons.add(close);
    
    <span class='keyword'>return</span> UiUtil.getCommandRow( buttons );
  }
  
  <span class='keyword'>private</span> <span class='keyword'>static</span> <span class='keyword'>void</span> setRegex(){
    Pattern regex = Pattern.compile(fRegexField.getText());
    RegexInputVerifier verifier = <span class='keyword'>new</span> RegexInputVerifier(regex, UseToolTip.FALSE);
    fInputField.setInputVerifier(verifier);
  }
}
 
</PRE>
<br>
<br>
<br>

</div>




<div class='topic-section'>See Also :</div>
<div class='main-body'>
 
  
  <a href='TopicAction2161-2.html?Id=1'>Type-Safe Enumerations</a> <br>
 
  
  <a href='TopicActioncc40-2.html?Id=87'>Parse text</a> <br>
 
  
  <a href='TopicAction3c83-2.html?Id=103'>Pattern-match lines of a file</a> <br>
 
  
  <a href='TopicAction11fc-2.html?Id=167'>Input dialogs</a> <br>
 
  
  <a href='TopicAction37c7-2.html?Id=186'>Use enums to restrict arguments</a> <br>
 
</div>


<div class='topic-section'>Would you use this technique?</div>
<div class='main-body'>
  
  <form action="http://www.javapractices.com/vote/AddVoteAction.do" method='post'>
    Yes<input type='radio' name='Choice' value='Y' >
    &nbsp;&nbsp;No<input type='radio' name='Choice' value='N'>
    &nbsp;&nbsp;Undecided<input type='radio' name='Choice' value="?" >
    &nbsp;&nbsp;<input type=submit value="Vote" >
    <input type='hidden' name='Operation' value='Apply'>
    <input type='hidden' name='TopicId' value='151'>
  </form>
</div>

<div style='height:10.0em;'></div>

 
 
</div>

  

 





<div align='center' class='legalese'>  
&copy; 2011 Hirondelle Systems |
<a href='../source/SourceAction-2.html'><b>Source Code</b></a><IMG class='no-margin' SRC="../images/goldstar.gif" ALT=""> |
<a href="mailto:webmaster@javapractices.com">Contact</a> |
<a href="http://creativecommons.org/licenses/by-nc-sa/1.0/">License</a> |
<a href='../apps/cjp.rss'>RSS</a>
<!-- ukey="2AC36CD2" -->
<!-- ckey="16DF3D87" -->
<br>

 Individual code snippets can be used under this <a href='../LICENSE.txt'>BSD license</a> - Last updated on June 6, 2010.<br>
 Over 150,000 unique IPs last month - <span title='Java Practices 2.6.5, Mon May 16 00:00:00 EDT 2011'>Built with</span> <a href='http://www.web4j.com/'>WEB4J</a>.<br>
 - In Memoriam : Bill Dirani -
</div>

<script src="../../www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2633428-1";
urchinTracker();
</script>



</body>

<!-- Mirrored from www.javapractices.com/topic/TopicAction.do?Id=151 by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 12 Jun 2011 17:28:07 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack -->
</html>
